using System;
using System.Collections;
using System.Data;
using BEGDC.CC.BL;
using BEGDC.CC.Entity;

namespace BEGDC.CC.BL.Common
{
	/// <summary>
	/// Define common methods.
	/// </summary>
	public interface IUtility
	{
		/// <summary>
		/// Build enabled item list of specified dictionary type.
		/// </summary>
		/// <param name="dicType">Dictionary type.</param>
		/// <returns></returns>
		IList GetMember( int AppId, string role );
		DataTable GetRoleMemberList(string UserRole, string CAT);

		IList BuildDicList( string dicType);

		IList GetAllDicItem( string dicType);

		DicItem GetDicItem( int id );
	    DicItem GetDicItem( string keyItemValue, string keyTypeValue );

		Entity.DicType GetDitTypeByDicItemKey( string itemKey );


		#region Added By Joe: 2006-10-16

		/// <summary>
		/// Get a DicItem's ID by it's type and DicItemKey
		/// </summary>
		/// <param name="keyItemValue"></param>
		/// <param name="keyTypeValue"></param>
		/// <returns>id</returns>
		int GetDicItemID( string keyItemValue, string keyTypeValue);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="keyTypeValue"></param>
		/// <returns></returns>
		int GetDicTypeID( string keyTypeValue );

		/// <summary>
		/// 
		/// </summary>
		/// <param name="typeValue"></param>
		/// <returns></returns>
		BEGDC.CC.Entity.DicType GetDicType( string typeValue );

		/// <summary>
		/// 
		/// </summary>
		void UpdateCustomerAttendee(int attendeeId);

		bool DeleteApplication(int appID);
		bool DeleteDraftApplication(int appID);

		#endregion 
		//...........

//		object GetAPNInfo( string APN );
//
//		IList GetAMKList( string APN );
//
//		object GetAMKInfo( string AMK );

//		string[] GetParentItem(string[] APN);

		/// <summary>
		/// 
		/// </summary>
		/// <returns>IList</returns>
		IList GetDicType();

		/// <summary>
		/// 
		/// </summary>
		/// <returns>IList</returns>
		BEGDC.CC.Entity.DicType GetDicType(int id);

		/// <summary>
		/// 
		/// </summary>
		/// <returns>IList</returns>
		IList GetAllDicType();

		/// <summary>
		/// Add a new DicType
		/// </summary>
		/// <param name="type"></param>
		/// <returns>int</returns>
		int AddDicType(BEGDC.CC.Entity.DicType type);

		/// <summary>
		/// Add a new DicType
		/// </summary>
		/// <param name="type"></param>
		/// <returns>int</returns>
		bool SaveDicType(BEGDC.CC.Entity.DicType type);

		#region LegalEntity
		/// <summary>
		/// 
		/// </summary>
		/// <returns>IList</returns>
		BEGDC.CC.Entity.LegalEntity GetLegalEntity(int id);

		/// <summary>
		/// 
		/// </summary>
		/// <returns>IList</returns>
		IList GetLegalEntity();

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		DataTable GetLegalEntityDataTable();

		/// <summary>
		/// Add a new LegalEntity
		/// </summary>
		/// <param name="type"></param>
		/// <returns>int</returns>
		int AddLegalEntity(BEGDC.CC.Entity.LegalEntity type);

		/// <summary>
		/// Add a new LegalEntity
		/// </summary>
		/// <param name="type"></param>
		/// <returns>int</returns>
		bool SaveLegalEntity(BEGDC.CC.Entity.LegalEntity type);
		#endregion

//		#region Hotel
//		/// <summary>
//		/// 
//		/// </summary>
//		/// <returns>IList</returns>
//		BEGDC.CC.Entity.Hotel GetHotel(int id);
//
//		/// <summary>
//		/// 
//		/// </summary>
//		/// <returns>IList</returns>
//		IList GetHotel();
//
//		/// <summary>
//		/// 
//		/// </summary>
//		/// <returns></returns>
//		DataTable GetHotelDataTable();
//
//		/// <summary>
//		/// Add a new Hotel
//		/// </summary>
//		/// <param name="type"></param>
//		/// <returns>int</returns>
//		int AddHotel(BEGDC.CC.Entity.Hotel type);
//
//		/// <summary>
//		/// Add a new Hotel
//		/// </summary>
//		/// <param name="type"></param>
//		/// <returns>int</returns>
//		bool SaveHotel(BEGDC.CC.Entity.Hotel type);
//		#endregion


		/// <summary>
		/// Add a new log
		/// </summary>
		/// <param name="type"></param>
		/// <returns>int</returns>
		bool SaveOperationLog(BEGDC.CC.Entity.OperationLog log);
	
		/// <summary>
		/// 
		/// </summary>
		/// <returns>IList</returns>
		DataTable GetOperationLog(string start, string end, bool isWorkflowLog);
		DataTable GetLoginoutLog( string start, string end );
		/// <summary>
		/// Add a new DicItem
		/// </summary>
		/// <param name="item"></param>
		/// <returns>int</returns>
		int AddDicItem(BEGDC.CC.Entity.DicItem item);

		/// <summary>
		/// Add a new DicType
		/// </summary>
		/// 		/// <param name="type"></param>
		/// <returns>int</returns>
		int SaveDicItem(BEGDC.CC.Entity.DicItem item);
		/// <summary>
		/// 
		/// </summary>
		/// <param name="attach"></param>
		/// <returns></returns>
		bool SaveAttachment(BEGDC.CC.Entity.Attachment attach);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="code"></param>
		/// <param name="type"></param>
		/// <returns></returns>
		Step QueryStepByCode(string code, int type);
		/// <summary>
		/// 
		/// </summary>
		/// <param name="code"></param>
		/// <returns></returns>
		State QueryStateByCode(string code);

		IList GetState();

		BEGDC.CC.Entity.ExchangeRate GetCurrencyExchange();

		void SaveCurrencyExchange(BEGDC.CC.Entity.ExchangeRate exchange);

		IList GetALLCATList();

		bool DeleteFileById( int fileId );

		DataTable GetCODStaffByAppID(int appid, bool isFilter);

		DataTable GetOCOStaffByAppID(int appid, bool isFilter);

		string[] DisplayAppAttachments(int AppId, string AttType);

		DataTable GetDepartmentFNC(string department);
		DataTable GetDepartmentFNCByCode(string department);

		#region Joan 2007-07-04 for Templates
		/// <summary>
		/// 
		/// </summary>
		/// <param name="attachOld"></param>
		/// <param name="attachNew"></param>
		/// <returns></returns>
		bool UpdateAttachment(Attachment attachOld,Attachment attachNew);
		bool SaveTemplate(BEGDC.CC.Entity.Template template);
		bool UpdateTemplate(Template tempOld,Template tempNew);
		bool DeleteTemplateByID(int templateID);
		#endregion

		#region SystemBulletin
		/// <summary>
		/// 
		/// </summary>
		/// <returns>IList</returns>
		BEGDC.CC.Entity.SystemBulletin GetSystemBulletin(int id);

		/// <summary>
		/// 
		/// </summary>
		/// <returns>IList</returns>
		IList GetSystemBulletin();

		/// <summary>
		/// Add a new SystemBulletin
		/// </summary>
		/// <param name="type"></param>
		/// <returns>int</returns>
		int AddSystemBulletin(BEGDC.CC.Entity.SystemBulletin type);

		/// <summary>
		/// Add a new SystemBulletin
		/// </summary>
		/// <param name="type"></param>
		/// <returns>int</returns>
		bool SaveSystemBulletin(BEGDC.CC.Entity.SystemBulletin type);

		void DeleteSystemBulletinById( int bulletinId );
		#endregion

        /// <summary>
        /// Province List
        /// </summary>
        DataTable GetProvinces();

        /// <summary>
        /// Category List
        /// </summary>
        DataTable GetCategories();

        /// <summary>
        /// Cluster List
        /// </summary>
        DataTable GetClusters();

        /// <summary>
        /// Executive List
        /// </summary>
        DataTable GetExecutives();

        IList BuildCheckBoxASBLeaders();

        void DeleteAppASBSenoirLeadersByAppID(int appID);

        void SaveASBLeaders(int appID, int ASBLeaderID);

        IList AppASBLeadersList(int appID);

        string GetDepartmentByCostCenter(int costcenterID);

        string GetDepartmentByCostCenter(string costcentername);

        string GetEmployeeDetailsByNameEN(string nameen);

        string GetRMBValueFromEuroValue(double euro);

        string GetCRNonB(string orgAppNo);

        string GetLvAmount(int level);

        void SaveLvAmount(string lv2Amount, string lv3Amount, string lv4Amount);
	}
}
